]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
NotificationDaemon: create the application proxy asynchronously
authorCarlos Garnacho <carlosg@gnome.org>
Sat, 26 Nov 2016 13:59:48 +0000 (14:59 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 26 Nov 2016 14:00:35 +0000 (15:00 +0100)
Clicking on calendar notifications might block till the DBus request times
out if the application being poked happens to be non-responsive. Perform
this asynchronously so we don't block if that is the case.

js/ui/notificationDaemon.js

index 9e942b46f8c1baed4b33cd50abb5fad896612e4d..120751bdeb954a7f402911f87fa8693279e9a0f4 100644 (file)
@@ -702,22 +702,28 @@ const GtkNotificationDaemonAppSource = new Lang.Class({
         return new MessageTray.NotificationApplicationPolicy(this._appId);
     },
 
-    _createApp: function() {
-        return new FdoApplicationProxy(Gio.DBus.session, this._appId, this._objectPath);
+    _createApp: function(callback) {
+        return new FdoApplicationProxy(Gio.DBus.session, this._appId, this._objectPath, callback);
     },
 
     activateAction: function(actionId, target) {
-        let app = this._createApp();
-        app.ActivateActionRemote(actionId, target ? [target] : [], getPlatformData());
-
+        this._createApp(function (app, error) {
+            if (error == null)
+                app.ActivateActionRemote(actionId, target ? [target] : [], getPlatformData());
+            else
+                logError(error, 'Failed to activate application proxy');
+        });
         Main.overview.hide();
         Main.panel.closeCalendar();
     },
 
     open: function() {
-        let app = this._createApp();
-        app.ActivateRemote(getPlatformData());
-
+        this._createApp(function (app, error) {
+            if (error == null)
+                app.ActivateRemote(getPlatformData());
+            else
+                logError(error, 'Failed to open application proxy');
+        });
         Main.overview.hide();
         Main.panel.closeCalendar();
     },